#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main() {
	int N, i=0,m,x=0;
	i = 1;
	m = 1;
	scanf("%d", &N);
	while (i <= N) {
		for (int j = 1; j <= i;j++)
		{
			m *= j;
		}
		x += m;
		i++;
		m = 1;
	}
	printf("%d\n", x);
	return 0;
}